<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/jquery-3.3.1.min.js"></script>
    <style>
        /* p:nth-child(even){
            color: red;
        } */
    </style>
</head>
<body>
    <div>div
    <p>p</p>
    <p>p</p>
    <p>p</p>
    <p>hello <span>span</span></p>
    <p>p</p>
    <p>p</p>
    <p>p</p>
</div>
    <div>
        <div>

            <h1>h1</h1>
        </div>
    </div>
    <input type="text">
    <script>
        // $("div p:last-child").css({color:"green"});
        // $("div p:first-child").css({color:"red"});
        // $("div p:not(:first-child)").css({color:"red"});
        // $("p:even").css({color:"red"});
        // $("p:odd").css({color:"red"});
        // $("p:eq(0)").css({color:"red"});
        // $("p:gt(3)").css({color:"red"});
        // $("p:lt(3)").css({color:"red"});
        $("input").focus(function(){
            $(":focus").css({backgroundColor:"yellow"})
        })
        // $("p:contains(hello)").css({backgroundColor:"red"});
        // $("div:has(h1)").css({backgroundColor:"red"});
        // $("span:parent").css({backgroundColor:"red"});

        

    </script>
</body>
</html>